package com.lingkun.demo.contants;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantWxUtils implements InitializingBean {

    @Value("${wx.open.app_id}")
    private String appId;

    @Value("${wx.open.mch_id}")
    private String mchId;

    @Value("${wx.open.privateKey}")
    private String privateKey;

    public static String WX_OPEN_APP_ID;
    public static String WX_OPEN_MCH_ID;
    public static String WX_OPEN_PRIVATEKEY;

    @Override
    public void afterPropertiesSet() throws Exception {
        WX_OPEN_APP_ID = appId;
        WX_OPEN_MCH_ID = mchId;
        WX_OPEN_PRIVATEKEY = privateKey;
    }
}
